import { REDIS_KEY } from "./declare/keys";
import { getRedisClient } from "./library/redis";

(async () => {
  const redisClient = getRedisClient();

  const watchinglist = await redisClient.smembers(
    REDIS_KEY.REDIS_KEY_NOW_WATCHING_ROOM
  );
  for (const roomId of watchinglist) {
    await redisClient.del(`${REDIS_KEY.REDIS_ROOMID_LOCK_PREFIX}:${roomId}`);
    console.log("clear", roomId);
  }
  await redisClient.del(REDIS_KEY.REDIS_KEY_NOW_WATCHING_ROOM);
  console.log('ALL DONE')
  process.exit()
})();
